/**
 * props的高级玩法
 */

import React, { Component } from 'react';


// 子组件
const Fnc = (props) => {
  console.log(props)
  return (
    <div>
      <h2>子组件</h2>
      {/* <p>{props.children}</p> */}
      <button onClick={() => {
        props.children(1000)
      }}>调用</button>
    </div>
  )
}


class Index extends Component {
  render() {
    return (
      <div>
        <h1>props的高级玩法</h1>
        <Fnc a='1000'>
          {
            (a) => {
              console.log(a)
            }
          }
        </Fnc>
      </div>
    );
  }
}

export default Index;
